﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<script language="javascript">
function showUploadDialog(s_Type, s_Link, s_Thumbnail){
var arr = showModalDialog("eWebEditor/dialog/i_upload.htm?style=popup&type="+s_Type+"&link="+s_Link+"&thumbnail="+s_Thumbnail, window, "dialogWidth:0px;dialogHeight:0px;help:no;scroll:no;status:no");}
</script>
<html>
<head>
<title>增加新闻</title>
<link href="images/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<%if request("type")="" then%>

<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" class="head"><strong>增加新闻</strong></td>
</tr>
<tr>
<td>
<form method="post" name="myform" action="admin_news_pass.asp?type=add">
    <table width="100%" border="0" align="center" cellpadding="6" cellspacing="0">
    <tr>
    <td width="15%"><div align="center">新闻标题<font color="#FF0000"> (中文)</font></div></td>
    <td colspan="3"><input name="title" type="text" id="title" size="40"></td>
    </tr>
    <tr id="EN_1">
    <td width="15%"><div align="center">新闻标题<font color="#FF0000"> (英文)</font></div></td>
    <td colspan="3"><input name="etitle" type="text" id="etitle" size="40"></td>
    </tr>
    <tr>
    <td width="15%"><div align="center">所属分类</div></td>
    <td colspan="3">
    <select name="ssfl" id="select">
    <%
    dim rsc
    set rsc=server.CreateObject("adodb.recordset")
    rsc.open "select * from Sort_News where id<>2 and id<>3 and id<>5",conn,1,1
    while not rsc.eof
    response.Write("<option value=""" & rsc("id") & """>" & rsc("Name") & "</option>")
    rsc.movenext
    wend
    rsc.close
    set rsc=nothing
    %>
    </select>    </td>
    </tr>
    <tr>
      <td><div align="center">是否固顶</div></td>
      <td colspan="3"><input type="checkbox" name="onTop" id="onTop" />
      <label for="onTop">是</label></td>
      </tr>
    <tr>
      <td><div align="center">是否推荐</div></td>
      <td colspan="3"><input type="checkbox" name="Elite" id="Elite" />
        <label for="Elite">是 </label></td>
      </tr>
    <tr>
      <td><div align="center">新闻缩略图</div></td>
      <td colspan="3"><input type="text" name="Thumb" size="50" />
        <input type="button" value="上传图片" onclick="showUploadDialog('image', 'myform.Thumb', '')" />
(缩略图尺寸：120*80)</td>
      </tr>
    <tr style="display:none;">
    <td width="15%"><div align="center">录入作者</div></td>
    <td width="21%"><input name="zz" type="text" id="zz" value="<%=session("admin")%>"></td>
    <td width="15%"><div align="center">新闻来源</div></td>
    <td><input name="ly" type="text" id="ly" value="本站"></td>
    </tr>
    <tr>
    <td width="15%"><div align="center">新闻内容<font color="#FF0000"> (中文)</font></div></td>
    <td colspan="3"><INPUT type="hidden" name="body" value="">
    <IFRAME ID="eWebEditor1" SRC="ewebeditor/ewebeditor.htm?id=body&style=popup" FRAMEBORDER="0" SCROLLING="no" WIDTH="100%" HEIGHT="400"></IFRAME></td>
    </tr>
    <tr id="EN_2">
    <td width="15%"><div align="center">新闻内容 <font color="#FF0000">(英文)</font></div></td>
    <td colspan="3"><INPUT type="hidden" name="ebody" value="">
    <IFRAME ID="eWebEditor1" SRC="ewebeditor/ewebeditor.htm?id=ebody&style=popup" FRAMEBORDER="0" SCROLLING="no" WIDTH="100%" HEIGHT="400"></IFRAME></td>
    </tr>
    <tr>
    <td width="15%">&nbsp;</td>
    <td colspan="3"><input type="submit" name="button"  value="確认提交" /></td>
    </tr>
    </table>
</form>
</td>
</tr>
</table>

<%else%>

<% 
exec="select * from news where id="& request.QueryString("id") 
set rs=server.createobject("adodb.recordset") 
rs.open exec,conn,1,1 
%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="30" class="head"><strong>管理新闻</strong></td>
</tr>
<tr>
<td>
<FORM method="post" name="myform" action="admin_news_pass.asp?type=update">
<input name="id" type="hidden" id="id" value="<%=request.querystring("id")%>"/>

    <table width="100%" border="0" align="center" cellpadding="6" cellspacing="0">
    <tr>
    <td width="15%"><div align="center">新闻标题<font color="#FF0000"> (中文)</font></div></td>
    <td width="37"><input name="title" type="text" id="title" value="<%=rs("title")%>" size="40"></td>
    </tr>
    <tr id="EN_1">
    <td width="15%"><div align="center">新闻标题<font color="#FF0000"> (英文)</font></div></td>
    <td><input name="etitle" type="text" id="etitle" value="<%=rs("etitle")%>" size="40"></td>
    </tr>
    <tr>
    <td width="15%"><div align="center">所属分类</div></td>
    <td>
    <select name="ssfl" id="select">
    <%
    set rsc=server.CreateObject("adodb.recordset")
    rsc.open "select * from Sort_News",conn,1,1
    while not rsc.eof
    if rs("ssfl")=rsc("id") then
    response.Write("<option value=""" & rsc("id") & """ selected>" & rsc("Name") & "</option>")
    else
    response.Write("<option value=""" & rsc("id") & """>" & rsc("Name") & "</option>")
    end if
    rsc.movenext
    wend
    rsc.close
    set rsc=nothing
    %>
    </select></td>
    </tr>
    <tr>
      <td><div align="center">是否固顶</div></td>
      <td><input type="checkbox" name="onTop" id="onTop" <%if rs("OnTop")=true then response.write ("checked='checked'") %> />
          <label for="onTop" s>是</label></td>
    </tr>
    <tr>
      <td><div align="center">是否推荐</div></td>
      <td><input type="checkbox" name="Elite" id="Elite" <%if rs("Elite")=true then response.write ("checked='checked'") %>/>
          <label for="Elite">是 </label></td>
    </tr>
    <tr>
      <td><div align="center">新闻缩略图</div></td>
      <td><input type="text" name="Thumb" size="50"  value="<%=rs("Thumb")%>"/>
          <input type="button" value="上传图片" onclick="showUploadDialog('image', 'myform.Thumb', '')" />
        (缩略图尺寸：165*120)</td>
    </tr>
    <tr>
    <td width="15%"><div align="center">新闻内容<font color="#FF0000"> (中文)</font></div></td>
    <td><input type="hidden" name="body" value='<%=replace(rs("body"),"'","&#39;")%>'/>
    <IFRAME ID="eWebEditor1" SRC="ewebeditor/ewebeditor.htm?id=body&style=popup" FRAMEBORDER="0" SCROLLING="no" WIDTH="100%" HEIGHT="400"></IFRAME></td>
    </tr>
    <tr id="EN_2">
    <td width="15%"><div align="center">新闻内容 <font color="#FF0000">(英文)</font></div></td>
    
    
    
    </tr>
    
    <tr>
    <td width="15%">&nbsp;</td>
    <td><input type="submit" name="button"  value="確认修改" /></td>
    </tr>
    </table>
</form>
</td>
</tr>
</table>

<%end if%>

</body>
</html>
<!--#include file="Language.asp"-->
